<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div id="app"></div>
  
  <template id="my-app">
    <!-- <h2 v-if="status === 1">{{time}}</h2>
    <h2 v-else-if="status === 2">{{time2}}</h2>
    <h2 v-else>{{time3}}</h2> 
    <button @click="change">切换</button> -->

    <h2 @click="hide" v-if="show">{{time}}</h2>

  </template>

  <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
  <script>
    const app = Vue.createApp({
      template: '#my-app',
      data() {
        return {
          time: '2023-12-08',
          time2: '2023年12月08日',
          time3: '2023/12/08',
          status: 1,
          show: true
        }
      },
      methods: {
        change() {
          // this.status = !this.status
          if (this.status === 3) {
            this.status = 0
          }
          this.status++
        },
        hide() {
          this.show = false
        }
      }
    })
    app.mount('#app')
  </script>

</body>
</html>